package za.org.jcicada.genss.alarm.impl;

import za.org.jcicada.genss.alarm.AlarmStatus;
import za.org.jcicada.genss.alarm.AlarmURN;
import za.org.jcicada.genss.alarm.IAlarm;

/**
 * Implementation of the IAlarm interface.
 * @author rcrida
 */
public class Alarm implements IAlarm {

    /**
     * The current status of the alarm.
     */
    private AlarmStatus status;
    
    /**
     * The alarm URI.
     */
    private AlarmURN alarmURN;
    
    /**
     * A descriptive message for the alarm.
     */
    private String message;
    
    /**
     * A flag to indicate if the alarm has been acknowledged.
     */
    private boolean acknowledged = false;
    
    /**
     * Construct an Alarm object
     * @param status the current alarm status
     * @param alarmURN the alarm URI
     * @param message a descriptive message for the alarm which should attempt to
     *                describe how to resolve it.
     */
    public Alarm(AlarmStatus status, AlarmURN alarmURN, String message) {
        this.status = status;
        this.alarmURN = alarmURN;
        this.message = message;
    }
    
    public AlarmStatus getStatus() {
        return status;
    }
    
    public AlarmURN getAlarmURN() {
        return alarmURN;
    }
    
    public String getMessage() {
        return message;
    }
    
    public void acknowledge() {
        acknowledged = true;
    }
    
    public boolean isAcknowledged() {
        return acknowledged;
    }
    
    public void setStatus(AlarmStatus status) {
        this.status = status;
    }
    
    public void setMessage(String message) {
        this.message = message;
    }

}
